// AWTColor.h: interface for the AWTColor class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_AWTCOLOR_H__1434121C_3D94_11D2_A3EF_006097A44215__INCLUDED_)
#define AFX_AWTCOLOR_H__1434121C_3D94_11D2_A3EF_006097A44215__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#define FACTOR		0.7

class AFX_EXT_CLASS AWTColor : public AWTObject  
{
DECLARE_DYNAMIC(AWTColor)
public:
	AWTColor(COLORREF rgb);
	AWTColor(AWTColor &c);
	AWTColor(int r, int g, int b);
	virtual ~AWTColor();

	static AWTColor* white()
		{return new AWTColor(255,255,255);}
	static AWTColor* lightGray()
		{return new AWTColor(192, 192, 192);}
	static AWTColor* gray()
		{return new AWTColor(128, 128, 128);}
	static AWTColor* darkGray()
		{return new AWTColor(64, 64, 64);}
	static AWTColor* black()
		{return new AWTColor(0, 0, 0);}
	static AWTColor* red()
		{return new AWTColor(255, 0, 0);}
	static AWTColor* pink()
		{return new AWTColor(255, 175, 175);}
	static AWTColor* orange()
		{return new AWTColor(255, 200, 0);}
	static AWTColor* yellow()
		{return new AWTColor(255, 255, 0);}
	static AWTColor* green()
		{return new AWTColor(0, 255, 0);}
	static AWTColor* magenta()
		{return new AWTColor(255, 0, 255);}
	static AWTColor* cyan()
		{return new AWTColor(0, 255, 255);}
	static AWTColor* blue()
		{return new AWTColor(0, 0, 255);}

	int getRed()
		{return (int)GetRValue(m_rgb);}
	int getGreen()
		{return (int)GetGValue(m_rgb);}
	int getBlue()
		{return (int)GetBValue(m_rgb);}

  AWTColor brighter() 
	{
		return AWTColor(min( (int)(getRed() * (1.0 / FACTOR)), 255), 
			min((int)(getGreen() * (1.0 / FACTOR)), 255),
			min((int)(getBlue() * (1.0 / FACTOR)), 255));
  }
	
	AWTColor darker() 
	{
		return AWTColor(max((int)(getRed()  *FACTOR), 0), 
			max((int)(getGreen()*FACTOR), 0),
			max((int)(getBlue() *FACTOR), 0));
  }

	COLORREF getColorRef()
		{return m_rgb;}

protected:
	COLORREF m_rgb;
};

#endif // !defined(AFX_AWTCOLOR_H__1434121C_3D94_11D2_A3EF_006097A44215__INCLUDED_)
